<template>
  <div class="main">
    <div class="pinkTitle">
      <div>说明:目前支持学科和关键字条件筛选</div>
      <el-button type="success" class="addBtn" @click="jumpCom">
        <i class="el-icon-edit"></i>新增试题
      </el-button>
    </div>
    <el-form ref="form" :model="from" label-width="80px" size="mini">
      <el-col :span="6">
        <el-form-item label="学科">
          <el-select
            v-model="from.subjectID"
            placeholder="请选择"
            class="inputEle"
          >
            <el-option label="前端" :value="4"></el-option>
            <el-option label="java" :value="1"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="二级目录">
          <el-select
            v-model="from.catalogID"
            placeholder="请选择"
            class="inputEle"
          >
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="标签">
          <el-select v-model="from.tags" placeholder="请选择" class="inputEle">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="关键字">
          <el-input v-model="from.keyword" class="inputEle"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="试题类型">
          <el-select
            v-model="from.questionType"
            placeholder="请选择"
            class="inputEle"
          >
            <el-option label="单选" value="shanghai" />
            <el-option label="多选" value="shanghai" />
            <el-option label="简答" value="beijing" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="难度">
          <el-select
            v-model="from.difficulty"
            placeholder="请选择"
            class="inputEle"
          >
            <el-option label="简单" value="shanghai" />
            <el-option label="一般" value="shanghai" />
            <el-option label="困难" value="beijing" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="方向">
          <el-select
            v-model="from.direction"
            placeholder="请选择"
            class="inputEle"
          >
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="录入人">
          <el-select
            v-model="from.creatorID"
            placeholder="请选择"
            class="inputEle"
          >
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="题目备注">
          <el-input v-model="from.remarks" class="inputEle"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="企业简称">
          <el-input v-model="from.shortName" class="inputEle"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="城市">
          <el-select
            v-model="from.province"
            placeholder="请选择"
            class="linkage"
          >
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
          <el-select v-model="from.city" placeholder="请选择" class="linkage">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item>
          <div class="btnMain">
            <el-button class="btn">清除</el-button>
            <el-button type="primary" class="btn" @click="searchEle">
              搜索
            </el-button>
          </div>
        </el-form-item>
      </el-col>
    </el-form>
  </div>
</template>
<script>
export default {
  data() {
    return {
      sizeForm: 1,
      from: {
        page: 1, // 页数
        pagesize: 99, // 也条数
        subjectID: '', // 学科
        difficulty: '', // 难度
        questionType: '', // 试题类型
        tags: '', // 标签名称
        province: '', // 企业所在省份
        city: '', // 企业所在城市
        keyword: '', // 关键字
        remarks: '', // 题目备注
        shortName: '', // 企业简称
        direction: '', // 方向
        creatorID: '', // 录入人
        catalogID: '' // 目录
      }
    }
  },
  methods: {
    // 跳转到新增
    jumpCom() {
      this.$router.push('/nested/menu1-3')
    },
    // 搜索按钮
    searchEle() {
      this.$emit('searchBtn', this.from)
    }
  }
}
</script>
<style scoped lang="scss">
.inputEle {
  width: 90%;
}
.linkage {
  width: 45%;
}
.btn {
  width: 55px;
  height: 31px;
}
.btnMain {
  margin-left: 43%;
}
.has-gutter {
  background-color: #9f2020;
  // .el-table thead
}
.pinkTitle {
  color: pink;
  font-size: 12px;
  margin-bottom: 35px;
}
.addBtn {
  height: 30px;
  width: 100px;
  float: right;
  font-size: 12px;
  padding: 7px;
}
</style>
